/*
  函数组合演示
*/

function compose(f, g) {
  return function (x) {
    return f(g(x))
  }
}

function reverse(array) {
  return array.reverse()
}

function first(array) {
  return array[0]
}

const last = compose(first, reverse)

console.log(last([1, 2, 3]))
